package pw.goyd.game.logic;

import pw.goyd.protocol.core.Serializer;
import pw.goyd.subscribe.PlayerCustomer;

import java.util.List;

/**
 * 修改金钱响应
 * 如果玩家金钱发生变化时推送
 *
 * @author StanWind
 */
public class UpdateMoneyResponse extends Serializer {
    private List<PlayerCustomer> pl;


    public List<PlayerCustomer> getPl() {
        return pl;
    }

    public void setPl(List<PlayerCustomer> pl) {
        this.pl = pl;
    }

    @Override
    protected void read() {


    }

    @Override
    protected void write() {
        for (PlayerCustomer p : pl) {
            writeString(p.getAccount_id());
            writeInt(p.getChangingGolds());
            p.gameFinish();//玩家完成游戏
            writeInt(p.getGold());
        }
    }


}
